<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>加法计算器</title>
		<script type="text/javascript">
			function add() {
				var n1 = Number(form1.n1.value);//parseint
				var n2 = Number(form1.n2.value);//parseint
				var n3 = n1 + n2;
				form1.n3.value = n3;
			}
		</script>
	</head>
	<body>
		<form name="form1" method="get">
			<p>第1个数:<input type="text" id="n1" /></p>
			<p>第2个数:<input type="text" id="n2" /></p>
			<p><input type="button" id="plus" value="加法" onclick="add()" /> </p>
			<p>计算结果<input type="text" id="n3" readonly="readonly" /></p>
		</form>
	</body>
</html>
